package com.house.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * @version 1.0
 * @Author OhygC
 * @since 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "用户对象DTO",description = "从客户端，由用户传入的数据封装在此entity中")
public class UserDTO {
    /** 用户名 */
    @ApiModelProperty(value = "用户名",name = "username",example = "用户名",required = true)
    @NotBlank(message = "用户名不能为空")
    @Size(max = 10,message = "用户名长度不能超过10")
    private String username;

    /** 密码 */
    @ApiModelProperty(value = "密码",name = "password",example = "123",required = true)
    @NotBlank(message = "密码不能为空")
    @Size(max = 20,message = "密码长度不能超过20")
    private String password;

    /** 姓名 */
    @ApiModelProperty(value = "姓名",name = "uname",example = "测试用户",required = true)
    @NotBlank(message = "姓名不能为空")
    @Size(max = 20,message = "姓名长度不能超过20")
    private String uname;

    /** 手机号 */
    @ApiModelProperty(value = "电话",name = "phone",example = "123456789",required = true)
    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "\\d{11}",message = "手机号格式不对")
    private String phone;

    /** * 身份证号 */
    @ApiModelProperty(value = "身份证号",name = "idcard",example = "123456789123456789",required = true)
    @NotBlank(message = "身份证不能为空")
    @Pattern(regexp = "\\w{18}",message = "身份证号格式不正确")
    private String idcard;

    /** 角色 */
    @ApiModelProperty(value = "用户角色",name = "userRole",example = "普通用户",required = true)
    @NotBlank(message = "角色不能为空")
    private String userRole;

    /** 提交审核的状态 */
    @ApiModelProperty(value = "审核状态",name = "state",example = "0",required = true)
    @NotBlank(message = "状态不能为空")
    private Integer state;

    private Integer page;
    private Integer size;
}
